package entity.core.plugins.mycraft.cc;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import org.bukkit.craftbukkit.libs.jline.internal.Log;

import util.core.plugins.mycraft.cc.DBConn;

public class SqlLink {
    public SqlLink(Connection db) {
        this.setLink(db);
        this.setCommand(null);
        this.setResult(null);
    }
	public Connection getLink() {
	    if(link == null)
	        Log.error("No Sql Link");;
		return link;
	}
	public void setLink(Connection link) {
		this.link = link;
	}
	public PreparedStatement getCommand() {
	    if(command == null)
	        Log.error("No Sql Command Set");
		return command;
	}
	public void setCommand(PreparedStatement command) {
		this.command = command;
	}
	public ResultSet getResult() {
	    if(result == null)
	        Log.error("No Sql Result");
		return result;
	}
	public void setResult(ResultSet result) {
		this.result = result;
	}
	private Connection link;  // sql 连接对象
	private PreparedStatement command;  // sql 语句
	private ResultSet result;  // sql 执行结果
}
